package example.avro.without_code_generation

import org.apache.avro.Schema
import org.apache.avro.generic.{GenericData, GenericRecord}

object CreatingUser extends App {
  val schema :Schema = new Schema.Parser().parse(getClass.getClassLoader.getResourceAsStream("user.avsc"))
  val user1:GenericRecord = new GenericData.Record(schema)
  user1.put("name","Hunter")
  user1.put("favorite_number",256)

  val user2:GenericRecord = new GenericData.Record(schema)
  user2.put("favorite_number",256)
  user2.put("favorite_color","red")

}
